 <{extends file="<{$tempdir}>/public/shopcenter.html"}>  
 <{block name=extendjs}>
<script src="<{$siteurl}>/templates/<{$tempdir}>/public/js/jquery.PrintArea.js" type="text/javascript" language="javascript"></script>
 <script src="<{$siteurl}>/templates/<{$tempdir}>/public/js/datepicker/WdatePicker.js" type="text/javascript" language="javascript"></script>
    <script>
  	var mynomenu='baseshorder';
  	</script>
 <{/block}> 
 <{block name=bodylist}>
 <!---content right start--->
  <div class="conWaiSet fr">
    <div class="shopSetTop"> <span>闪惠订单统计</span> 
	
				                  <span style=" float:right; margin-right:10px;"><a style="color:lime; font-weight:bold;" href="<{ofunc type=url link="/shopcenter/shophuiorder"}>">闪惠订单</a></span>
	   <span style=" float:right; margin-right:5px;"><a style="color:lime; font-weight:bold;" href="<{ofunc type=url link="/shopcenter/setshophui"}>">闪惠设置</a></span>

	</div>
    <div class="orderTongji">
      <div class="sjser" style="font-weight:none;">商家闪惠订单统计查询</div>
      <form action="<{ofunc type=url link="/shopcenter/shophuitotal"}>" method="post" id="chafrom">  
      <div style="background:#311f16;">
      <span>年份 :
      <select name="year" onchange="selectyear();">
      	<option selected="selected" value="0">所有</option>
      	<{section name=loop loop=$startyear step=1 max=10}> 
      	<option value="<{$startyear-$smarty.section.loop.index}>"><{$startyear-$smarty.section.loop.index}></option>
        <{/section}>
      	 
      </select>
      
      </span>
      <span id="showmonth"> 
      	
      	<!-- 月份：
      <select name="month" onchange="selectmonth">
      	<option selected="selected" value="">全年</option>
        <option value="">1</option>
        <option value="">2</option>
        <option value="">3</option>
        <option value="">4</option>
      </select>  -->
      </span>
      <span id="showday">
      	<!--日：
      <select name="day">
      	<option selected="selected" value="">全年</option>
        <option value="">1</option>
        <option value="">2</option>
        <option value="">3</option>
        <option value="">4</option>
      </select>
      -->
      </span>
      <span>订单数：<span class="ddnum"><{$allnum}>单</span></span>
       <span>实际交易额：<span class="ddnum"><{$allsum}>元</span></span>
       <span class="tingjiSer curbtn" id="dosubmit"></span>
       
       </div>
       </form>  
      <div class="cl"></div>
    </div>
    <div class="cl"></div>
    <div class="caidanSet"> 
      	
      <!---留言管理----->
    
        <div class="mes_box" style="display:block;" id="liuyan">        
            <table cellpadding="0" cellspacing="0" width="100%">
              <tbody>
                <tr>
                 <th width="20%">时  间</th>
                 <th width="20%">订单数量</th>
                  <th width="20%">买单消费总金额（元）</th>
                   <th width="20%">买单优惠总金额（元）</th>
                    <th width="20%">买单实际总金额（元）</th>
                  
                         
                </tr>
                <{foreach from=$list item=items}>
                <tr>
                  <td><{$items['name']}></td>
                  <td><{$items['orderNum']|default:'0'}></td>
                  <td><{$items['xfcost']}></td>
                  <td><{$items['yhcost']}></td>
                  <td><{$items['sjcost']}></td>
            
                </tr>
                <{/foreach}>
             
              </tbody>
            </table>
         
        </div>
        
        
       
   
    </div>
  </div>
  <div class="cl"></div>
  
  <!---content right end---> 
 
 <script>
 	var nowyear = '<{$year}>';
 	var nowmonth = '<{$month}>'; 
$(function(){
 	 	$('#dosubmit').click(function(){
 	 		$('#chafrom').submit();
    });
    $("select[name='year']").val(nowyear);//find("option[text='"+nowyear+"']").attr("selected",true);
    selectyear();
}); 

function selectyear(){
   var nowyear = $("select[name='year']").find("option:selected").val(); 
   if(nowyear == 0){
      $('#showmonth').html('');
      $('#showday').html('');
   }else{
   	  var htmls='月份: <select name="month" > <option selected="selected" value="0">全年</option>';
   	  for(var i=1;i< 13;i++){
   	  	htmls+='<option value="'+i+'">'+i+'</option>';
   	  } 
      htmls+='</select>';
      $('#showmonth').html(htmls);
       $("select[name='month']").val(nowmonth);
     //  selectmonth();
   }
} 
function getDays(nowyear,nowmonth){ 
var y = nowyear;
var m = nowmonth;
if(m == 2){
return y % 4 == 0 ? 29 : 28;
}else if(m == 1 || m == 3 || m == 5 || m == 7 || m == 8 || m == 10 || m == 12){
return 31;
}else{
return 30;
}
}
 	</script>
 
 
 
 <{/block}>